//@version=6
indicator("Wyckoff Volatility & Volume Ratios [S-Ratio & V-Ratio]", overlay=false)

// Inputs
atrLength   = input.int(14, title="ATR Length", minval=1)
volMaLength = input.int(20, title="Volume MA Length", minval=1)

// Calculations
sRatio = (high - low) / ta.atr(atrLength)
vRatio = volume / ta.sma(volume, volMaLength)

// Plots
plot(sRatio, title="S-Ratio (Range/ATR)", color=color.blue, linewidth=2)
plot(vRatio, title="V-Ratio (Vol/SMA20)", color=color.orange, linewidth=2)

// Threshold Reference Lines
hline(2.0, "Climactic Level (2.0)", color=color.purple, linestyle=hline.style_dashed)
hline(1.5, "High Threshold / Climax (1.5)", color=color.red, linestyle=hline.style_dashed)
hline(1.2, "Wide Spread / High Vol (1.2)", color=color.green, linestyle=hline.style_dotted)
hline(0.8, "Narrow Spread / Low Vol (0.8)", color=color.gray, linestyle=hline.style_dotted)